package chapter8_线程池的使用;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

public class UnConfigurableThreadPool {
    public static void main(String[] args) {
        ExecutorService exec = Executors.newCachedThreadPool();
        ((ThreadPoolExecutor) exec).setCorePoolSize(10);
        // 返回DelegatedExecutorService委派类，屏蔽修线程池相关配置方法
        ExecutorService unConfigurableExec = Executors.unconfigurableExecutorService(exec);
    }
}
